GGGGLLLL____DDDDSSSSTTTT____AAAALLLLPPPPHHHHAAAA, GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____DDDDSSSSTTTT____AAAALLLLPPPPHHHHAAAA, and GGGGLLLL____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA____SSSSAAAATTTTUUUURRRRAAAATTTTEEEE.
The initial value is GGGGLLLL____OOOONNNNEEEE.
Additionally, if the GGGGLLLL____AAAARRRRBBBB____iiiimmmmaaaaggggiiiinnnngggg extension is supported, the
following constants are accepted: GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____CCCCOOOOLLLLOOOORRRR,
GGGGLLLL____DDDDSSSSTTTT____AAAALLLLPPPPHHHHAAAA, and GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____DDDDSSSSTTTT____AAAALLLLPPPPHHHHAAAA. The initial value is
GGGGLLLL____ZZZZEEEERRRROOOO.
Additionally, if the GGGGLLLL____AAAARRRRBBBB____iiiimmmmaaaaggggiiiinnnngggg extension is supported, the
following constants are accepted: GGGGLLLL____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____CCCCOOOOLLLLOOOORRRR,
In RGBA mode, pixels can be drawn using a function that blends the
incoming (source) RGBA values with the RGBA values that are already in
the frame buffer (the destination values). Blending is initially
disabled. Use ffffggggllllEEEEnnnnaaaabbbblllleeee and ffffggggllllDDDDiiiissssaaaabbbblllleeee with argument GGGGLLLL____BBBBLLLLEEEENNNNDDDD to enable
and disable blending.
ffffggggllllBBBBlllleeeennnnddddFFFFuuuunnnncccc defines the operation of blending when it is enabled.
_s_f_a_c_t_o_r specifies which of nine methods is used to scale the source color
components. _d_f_a_c_t_o_r specifies which of eight methods is used to scale
the destination color components. The eleven possible methods are
described in the following table. Each method defines four scale
factors, one each for red, green, blue, and alpha.
In the table and in subsequent equations, source and destination color
components are referred to as (R ,G ,B ,A ) and (R ,G ,B ,A ). The color
s s s s d d d d
specified by ffffggggllllBBBBlllleeeennnnddddCCCCoooolllloooorrrr is referred to as (R ,G ,B ,A ). They are
c c c c
understood to have integer values between 0 and (k ,k ,k ,k ), where
To determine the blended RGBA values of a pixel when drawing in RGBA
mode, the system uses the following equations:
R = min(k R s + R d )
d R, s R d R
G = min(k G s + G d )
d G, s G d G
B = min(k B s + B d )
d B, s B d B
A = min(k A s + A d )
d A, s A d A
Despite the apparent precision of the above equations, blending
arithmetic is not exactly specified, because blending operates with
imprecise integer color values. However, a blend factor that should be
equal to 1 is guaranteed not to modify its multiplicand, and a blend
factor equal to 0 reduces its multiplicand to 0. For example, when
_s_f_a_c_t_o_r is GGGGLLLL____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA, _d_f_a_c_t_o_r is GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA, and A is
s
equal to k , the equations reduce to simple replacement:
Transparency is best implemented using blend function (GGGGLLLL____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA,
GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA) with primitives sorted from farthest to nearest.
Note that this transparency calculation does not require the presence of
alpha bitplanes in the frame buffer.
Blend function (GGGGLLLL____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA, GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA) is also useful for
rendering antialiased points and lines in arbitrary order.
Polygon antialiasing is optimized using blend function
(GGGGLLLL____SSSSRRRRCCCC____AAAALLLLPPPPHHHHAAAA____SSSSAAAATTTTUUUURRRRAAAATTTTEEEE, GGGGLLLL____OOOONNNNEEEE) with polygons sorted from nearest to
farthest. (See the ffffggggllllEEEEnnnnaaaabbbblllleeee, ffffggggllllDDDDiiiissssaaaabbbblllleeee reference page and the
GGGGLLLL____PPPPOOOOLLLLYYYYGGGGOOOONNNN____SSSSMMMMOOOOOOOOTTTTHHHH argument for information on polygon antialiasing.)
Destination alpha bitplanes, which must be present for this blend
function to operate correctly, store the accumulated coverage.
NNNNOOOOTTTTEEEESSSS
Incoming (source) alpha is correctly thought of as a material opacity,
ranging from 1.0 (K ), representing complete opacity, to 0.0 (0),
A
representing complete transparency.
When more than one color buffer is enabled for drawing, the GL performs
blending separately for each enabled buffer, using the contents of that
buffer for destination color. (See ffffggggllllDDDDrrrraaaawwwwBBBBuuuuffffffffeeeerrrr.)
Blending affects only RGBA rendering. It is ignored by color index
GGGGLLLL____OOOONNNNEEEE____MMMMIIIINNNNUUUUSSSS____CCCCOOOONNNNSSSSTTTTAAAANNNNTTTT____AAAALLLLPPPPHHHHAAAA are only available if the GGGGLLLL____AAAARRRRBBBB____iiiimmmmaaaaggggiiiinnnngggg is
supported by your implementation.
EEEERRRRRRRROOOORRRRSSSS
GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____EEEENNNNUUUUMMMM is generated if either _s_f_a_c_t_o_r or _d_f_a_c_t_o_r is not an
accepted value.
GGGGLLLL____IIIINNNNVVVVAAAALLLLIIIIDDDD____OOOOPPPPEEEERRRRAAAATTTTIIIIOOOONNNN is generated if ffffggggllllBBBBlllleeeennnnddddFFFFuuuunnnncccc is executed between the
execution of ffffggggllllBBBBeeeeggggiiiinnnn and the corresponding execution of ffffggggllllEEEEnnnndddd.